#include "drink.h"

drink::drink(drink &drk) // 拷贝构造
{
    std::cout << "拷贝构造" << std::endl;
    this->ID = drk.ID;
    this->name = drk.name;
    this->price = drk.price;
}

drink::~drink()
{
    std::cout << "析构函数" << std::endl;
}

std::string drink::getID()
{
    return ID;
}

std::string drink::getname()
{
    return name;
}

void drink::setname(const std::string &_name)
{
    this->name = _name;
}

float drink::getprice()
{
    return price;
}

void drink::setprice(float _price)
{
    this->price = _price;
}

void drink::show()
{
    std::cout << ID << "\t" << name << "\t" << price << std::endl;
}

drink drink::operator=(const drink &drk)
{
    this->ID = drk.ID;
    this->name = drk.name;
    this->price = drk.price;

    return *this;
}